<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="karaoke.negocio.GestionProducto"%>
<%@page import="karaoke.modelo.Producto"%>
<%@page import="karaoke.modelo.TipoProducto"%>
<%@page import="karaoke.servlets.BuscarProductoServlet"%>
<%@page import="karaoke.negocio.GestionProducto,java.util.*"%>
<%@page import="java.util.Collection, karaoke.excepcion.DAOExcepcion"%>

<html lang="en">
<head>
<meta charset="iso-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<title>Bootstrap, from Twitter</title>

<script src="js/jquery-1.9.1.js"></script>
<script src="js/jquery-ui-1.10.2.custom.js"></script>

<!-- Le styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/bootswatch.css" rel="stylesheet">
<link href="css/jquery-ui-1.10.2.custom.css" rel="stylesheet">

<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

</head>

<body class="preview" id="top">

	<div class="container">

		<div class="row">

			<div class="span8">

				<div class="well">

					<form class="form-horizontal well" name="frmBuscarSala"
						method="post" action="BuscarSalaServlet">
						<fieldset>
							<legend>
								<h4>Busqueda de Salas:</h4>
							</legend>

							<div class="control-group">
								<label class="control-label" for="input01">Nombre de
									Sala:</label>
								<div class="controls">
									<input type="text" class="input-medium" id="txtnomsala"
										name="txtnomsala">
								</div>

								<br></br>
								<table class="table table-striped">
									<tr>
										<td width="73"><div align="left">
												<strong>IdLocal</strong>
											</div></td>
										<td width="73"><div align="left">
												<strong>IdSala</strong>
											</div></td>
										<td width="90"><div align="left">
												<strong>Nombre</strong>
											</div></td>
										<td width="95"><div align="left">
												<strong>Capacidad</strong>
											</div></td>


										<%@page
											import="java.util.Collection,java.util.ArrayList,karaoke.modelo.*"%>
										<%
	    Collection<Sala> lista = new ArrayList<Sala>();
		lista= (Collection<Sala>) request.getAttribute("LISTASALAS");
		
		if(lista!=null){
	  		for(Sala csala : lista){%>
									
									<tr>
										<div align="center">
											<td><%= csala.getLocal().getCodigo() %></td>
											<td><%= csala.getCodigo() %></td>
											<td><%= csala.getNombre() %></td>
											<td><%= csala.getCapacidad() %></td>
											<td><a
												href="SalaEditarServlet?idsala=<%= csala.getLocal().getCodigo()+csala.getCodigo() %>">Editar</a>

												<%
            	if(csala.getEliminado()==0)
            	{
            %>
											<td><a
												href="SalaEliminarServlet?idsala=<%= csala.getLocal().getCodigo()+csala.getCodigo()%>&accion=E">Eliminar</a>
												<%
            	}
            	else if (csala.getEliminado() == 1)
            	{
            %>
											<td><a
												href="SalaEliminarServlet?idsala=<%= csala.getLocal().getCodigo()+csala.getCodigo()%>&accion=A">Activar</a>
												<%  
                }
            %></td>
										</div>
									</tr>
									<%
 		                            }
  	                }
      %>

									</tr>
								</table>

							</div>

							<div class="form-actions">
								<input type="submit" value="Buscar" id="evento_buscar"
									name="evento_buscar" /> <input type="button" name="Submit"
									value="Nuevo" onclick="window.location='Sala.jsp'">

							</div>
						</fieldset>
					</form>
				</div>
			</div>
			<div class="span4"></div>
		</div>

		<footer>
		<p></p>
		</footer>

	</div>
	<!-- /container -->

	<!-- Le javascript
    ================================================== -->
	<script src="js/bootstrap-affix.js"></script>
	<script src="js/bootstrap-alert.js"></script>
	<script src="js/bootstrap-button.js"></script>
	<script src="js/bootstrap-carousel.js"></script>
	<script src="js/bootstrap-collapse.js"></script>
	<script src="js/bootstrap-dropdown.js"></script>
	<script src="js/bootstrap-modal.js"></script>
	<script src="js/bootstrap-tooltip.js"></script>
	<script src="js/bootstrap-popover.js"></script>
	<script src="js/bootstrap-scrollspy.js"></script>
	<script src="js/bootstrap-tab.js"></script>
	<script src="js/bootstrap-transition.js"></script>
	<script src="js/bootstrap-typeahead.js"></script>

	<script>
		$(function() {
			$( "#datepicker" ).datepicker();
		});
	</script>




</body>
</html>
